home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Games / roids / score.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-03  |  1.8 KB  |  58 lines

  1. /*
  2.  * Copyright 1989 Digital Equipment Corporation
  3.  *
  4.  * Permission to use, copy, modify, and distribute this software and its
  5.  * documentation for any purpose and without fee is hereby granted,
  6.  * provided that the above copyright notice appear in all copies and that
  7.  * both that copyright notice and this permission notice appear in
  8.  * supporting documentation, and that the name of Digital Equipment
  9.  * Corporation not be used in advertising or publicity pertaining to
  10.  * distribution of the software without specific, written prior
  11.  * permission.  Digital Equipment Corporation makes no representations
  12.  * about the suitability of this software for any purpose.  It is
  13.  * provided "as is" without express or implied warranty.
  14.  *
  15.  * DIGITAL EQUIPMENT CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO
  16.  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  17.  * FITNESS, IN NO EVENT SHALL DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR
  18.  * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  19.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  20.  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
  21.  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  22.  *
  23.  * Author:  Terry Weissman
  24.  *          weissman@decwrl.dec.com
  25.  */
  26.  
  27. /* score.c -- Print the score. */
  28.  
  29. #include "roids.h"
  30.  
  31. static int nextbonus;
  32.  
  33. PaintScore()
  34. {
  35.     static Arg args[] = {
  36.     {"label", NULL},
  37.     };
  38.     char str[500];
  39.     
  40.     if (score >= nextbonus) {
  41.     shipsleft++;
  42.     nextbonus += 10000;
  43.     }
  44.     sprintf(str, "Ships on reserve: %d                Score: %d",
  45.         shipsleft, score);
  46.     args[0].value = (XtArgVal) str;
  47.     XtSetValues(scorewidget, args, XtNumber(args));
  48. }
  49.  
  50.  
  51. InitScore()
  52. {
  53.     score = 0;
  54.     shipsleft = 3;
  55.     nextbonus = 10000;
  56.     PaintScore();
  57. }
  58.